#include "testApp.h"


void testApp::setup() {
	ofSetLogLevel(OF_LOG_NOTICE);
    setSetupMode( true );
    //setSimulationMode( true );  //uncomment this to use mouse simulation
    //setVideoPlayerMode( true );   //comment this out to run live from cam
    setVideoPlayerFile("touchkit-fingers.mov");
    bDragging = false;
}


void testApp::update(){
	ofBackground( 0,0,0 );
}


void testApp::draw() {
    ofEnableAlphaBlending();

    if( bDragging ) {
        ofFill();
        bDragging = false;
    } else {
        ofNoFill();
    }

	for( int i=0; i<getNumTouches(); i++ ) {
        ofSetColor( 180, 0, 0, 100 );
        ofCircle( getTouch(i).x, getTouch(i).y, 2*getTouch(i).radius );
        ofSetColor( 200, 0, 0, 255 );
        ofCircle( getTouch(i).x, getTouch(i).y, 0.5*getTouch(i).radius );
	}
}


void testApp::keyPressed( int key ) {}
void testApp::keyReleased( int key ) {}

void testApp::mouseMoved( int x, int y ) {}
void testApp::mouseDragged( int x, int y, int button ) {}
void testApp::mousePressed( int x, int y, int button ) {}
void testApp::mouseReleased( int x, int y, int button ) {}
void testApp::windowResized( int w, int h ) {}

void testApp::touchDown( ofxTouch& touch ) {}
void testApp::touchMove( ofxTouch& touch ) {
    bDragging = true;
}
void testApp::touchUp( ofxTouch& touch ) {}

